<div id="toolBar">
	<ul class="FirstLevel">
	<li><a href="#">File</a>
		<ul class="SecondLevel">
		<? if(!isset($_GET['action'])) { ?>
			<li><a href="#" onClick="window.location='edit.php?action=INSERT'">Nuovo</a></li>
			<li><a href="#" onClick="window.location.reload();">Refresh</a></li>
		<? } ?>
		<? if($_GET['action'] == "runPlugin") { ?>
			<li><a href="#" onClick="window.location.reload();">Refresh</a></li>
			<li><a href="content.php">Chiudi plugin</a></li>
		<? } ?>
		<? if($_GET['action'] == "EDIT") { ?>
			<li><a href="javascript:document.editForm.submit();">Salva</a></li>
			<li><a href="#" onClick="window.location.reload();">Refresh</a></li>
			<li><a href="content.php">Torna alla lista</a></li>
		<? } ?>
		<? if($_GET['action'] == "INSERT") { ?>
			<li><a href="javascript:FF.contents.SAVE();">Salva</a></li>
			<li><a href="javascript:FF.contents.SAVE_AND_REDO();">Salva e inserisci nuovo</a></li>
			<li><a href="#" onClick="window.location.reload();">Refresh</a></li>
			<li><a href="content.php">Torna alla lista</a></li>
		<? } ?>
		<li><a href="#" onclick="window.parent.location = 'login.php?action=logout'">Logout / Exit</a></li>
		</ul>
	</li>
	<li><a href="#">Contenuti</a>
		<ul class="SecondLevel">
		<? if(strpos($_SERVER['PHP_SELF'], 'content.php') !== false) { ?>
			<li><a class="toolBarContent">Dati per pagina <input id="dataPerPageSetter" type="text" size="2" value="<?=$_CONF->get("TABLE.dataPerPage", $_TABLE->CONF);?>" /><input type="button" value="OK" onclick="FF.configurator.setDataPerPage('<?=$_TABLE->table?>', $F('dataPerPageSetter'));" /></a></li>
		<? } ?>
		<? if(strpos($_SERVER['PHP_SELF'], 'edit.php') !== false) { ?>
			<li><a href="#" onClick="document.editForm.submit();">Salva contenuti</a></li>
		<? } ?>
		<li><a href="#" onClick="FF.contents.getExcelDump('<?=$_TABLE->table?>');">Esporta tabella in Excel</a></li>
		<li><a href="#" onClick="FF.contents.getCSVDump('<?=$_TABLE->table?>');">Esporta tabella in CSV</a></li>
		<?
		if(!isset($_GET['action'])) { 
			$plugins = $_CONF->get("TABLE>PLUGINS.childNodes", $_TABLE->CONF);
			if($plugins != false) {
				foreach($plugins as $plugin) {
					echo '<li><a href="pluginManager.php?action=runPlugin&table='.$_TABLE->table.'&name='.str_replace('"', "'", $plugin['attributes']['NAME']).'&file='.$plugin['attributes']['VALUE'].'">'.$plugin['attributes']['NAME'].'</a></li>';
				}
			}
		} 
		?>
		</ul>
	</li>
	<? if($_SESSION['FF']['logType'] == 2) { ?>
	<li><a href="#">Settings</a>
		<ul class="SecondLevel">
		<li><a href="#" onClick="window.location = 'conf/configurator.php?configuring=<?=$_TABLE->table?>'">Setup</a></li>
		<li><a href="#" onclick="FF.Console.show();">Mostra console</a></li>
		</ul>
	</li>
	<? } ?>
	</ul>
	<input type="hidden" id="tableName" value="<?=$_TABLE->table?>">
	<div class="clear"><br></div>
	<!--
	
	 | <input type="text" id="datasPerPage" style="width:40px" value="<?=$_CONF->get("TABLE.dataPerPage", $_TABLE->CONF);?>"> <input type="button" value="DATI PER PAGINA" onClick="window.location='content.php?dataPerPage='+document.getElementById('datasPerPage').value;">
	 -->
</div>